package com.heatup.apt.management.service.impl;

import com.heatup.apt.common.dao.ResourceMapper;
import com.heatup.apt.management.service.ResourceService;
import com.heatup.apt.model.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by b3st9u on 16/9/29.
 */
@Service
public class ResourceServiceImpl  implements ResourceService{
    //int parentId, String parendType, String resType, String resKey, String url, String proviewUrl
    @Autowired
    ResourceMapper resourceMapper;

    @Override
    public int saveResource(Resource resource) {
        int count=resourceMapper.insertSelective(resource);
        return count;
    }
    
    // 根据课程id删除课程的相关资源
	@Override
	public int delteResourceByCourseId(int courseId) {
		int bool = resourceMapper.deleteByCourseId(courseId);
		return bool;
	}
}
